﻿'Author : Jawad Najim
'Date : 2/09/2012


Public Class Course

    Private cID As String
    Private cName As String
    Private cDepartment As String
    Private cDescription As String
    Private cCredit As Integer

    Public Property CourseID() As String
        Get
            Return cID
        End Get
        Set(ByVal value As String)
            cID = value
        End Set
    End Property

    Public Property CourseTitle() As String
        Get
            Return cName
        End Get
        Set(ByVal value As String)
            cName = value
        End Set
    End Property

    Public Property CourseDepartment() As String
        Get
            Return cDepartment
        End Get
        Set(ByVal value As String)
            cDepartment = value
        End Set
    End Property

    Public Property CourseDescription() As String
        Get
            Return cDescription
        End Get
        Set(ByVal value As String)
            cDescription = value
        End Set
    End Property

    Public Property CourseCredit() As Integer
        Get
            Return cCredit
        End Get
        Set(ByVal value As Integer)
            cCredit = value
        End Set
    End Property

    'Two courses are equal only if they have the same ID and belong to the same department
    Public Shadows Function Equals(crs As Course) As Boolean
        If cID = crs.cID AndAlso cDepartment = crs.cDepartment Then
            Return True
        End If
        Return False
    End Function

End Class
